import { createStore, useStore } from "vuex";
import Vuex from 'vuex'

export interface State {
    isLogin: boolean
}

export default Vuex.createStore({
    // 登录状态
    state: {
        isLogin: false,
    },
    // 登录状态修改
    mutations: {
        setLogin(state: State, isLogin: boolean) {
            state.isLogin = isLogin
        },
    },
    // 获取登录状态
    getters: {
        getIsLogin(state: State) {
            return state.isLogin
        }
    }
})